//
// Ephi - simulation of magnetic fields and particles
// Copyright (C) 2007 Indrek Mandre <indrek(at)mare.ee>
// For more information please see http://www.mare.ee/indrek/ephi/
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#include "ephi.hpp"

#define BIG

#ifdef BIG
#define W 640
#define H 480
#else
#define W 347
#define H 347
#endif

int main (int argc, char *argv[])
{
  {
    Statics statics;
    ElectroDynamics dyn(statics);
    make_solenoid (statics, 5, 0.1, 0.008, 0.05, 5000);
    Screen screen(W, H, 0.9, 0.9 * H / W);
    Scene scene(dyn);
    printf ("OK: calculating solenoid\n");
    scene.calc (screen);
    printf ("OK: calc done\n");
    scene.set_coloring (0, true);
    scene.render_lic_animation (screen, "solenoid_bfield_anim", 16);
  }

  {
    Statics statics;
    ElectroDynamics dyn(statics);
    make_polywell_cube (statics, 0.3, 0.02, 0.01, 100000);
    Screen screen(W, H, 1.2, 1.2 * H / W);
    Scene scene(dyn);
    printf ("OK: calculating polywell\n");
    scene.calc (screen);
    printf ("OK: calc done\n");
    scene.set_coloring (0, true);
    scene.render_lic_animation (screen, "polywell_bfield_anim", 16);
  }

  return 0;
}

